import java.util.Scanner;

public class NGuessNumber {
  Scanner scan = new Scanner(System.in);
  int [] answers=new int[4];
  int [] guesses=new int[4];

  public int [] generateAnswers(){
    answers[0]= (int) (Math.random()*10);
    int i = 1;
    int answer;
    while (i < 4){
      answer = (int) (Math.random()*10);
      boolean same = false;
      int j = 0;
      while (j < i){
        if (answer == answers[j]){
          same = true;
          break;
        }
        j = j + 1;
      }
      if (!same){
        answers[j] = answer;
        i = i + 1;
      }
    }
    return answers;
  }
  public void receiveGuesses(){
    int i = 0;
    while (i < 4){
      try {
        guesses[i] = scan.nextInt();
        i = i+1;
      } catch (Exception e) {
        scan.next();
        System.out.println("请重新输入数字");
      }
    }
  }

  public void isWin(){

  }

  public static void main(String[] args) {
    NGuessNumber ngn=new NGuessNumber();
    int[] answers = ngn.generateAnswers();
    for (int i = 0; i < answers.length; i++) {
      System.out.println(answers[i]);
    }
    ngn.receiveGuesses();
  }
}
